home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8640 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: news.rain.org!usenet
  2. From: "Guus Leeuw jr." <guusl@eiffel.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Linking WASM to WPP code
  5. Date: Sun, 25 Feb 1996 10:59:08 -0800
  6. Organization: Interactive Software Engineering Inc. http://www.eiffel.com/
  7. Message-ID: <3130B17C.219A02F9@eiffel.com>
  8. References: <4gg5m3$4f0@news1.usa.pipeline.com> <1996Feb23.142043.5037@pat.uwe.ac.uk>
  9. NNTP-Posting-Host: @outback.eiffel.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (X11; I; Linux 1.2.8 i586)
  14.  
  15. P Ross wrote:
  16. > I have some code which is written in C which I'm trying to get working with
  17. > the watcom c plus plus compiler. It calls an external assembler procedure
  18. > which even though compiles ok won't link into my code. I keep getting an
  19. > undefined refernce.
  20. > How should I prototype the function in the C++ code to get it to work ?
  21. > The assembler proc is _VR_ResetTimer, and in my code I have void
  22. > VR_ResetTimer(void).
  23.  
  24. Two things:
  25. a) your ASM proc must be compiled with C calling conventions;
  26. b) your prototype must be `extern "C"'. The C++ compiler will then apply C name mangling
  27. instead of C++ name mangling.
  28.  
  29. If it still doesn't work this way, you might try to remove the leading underscore in
  30. your ASM source. I don't know what your assembler does, but I do know that MASM 6.0
  31. (Microsoft Macro Assembler) puts a leading underscore on any proc with C calling
  32. conventions.
  33.  
  34. Hope this helps,
  35.     Guus
  36.